package cc.comac.mom.api;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import cc.comac.mom.bean.EquipDocumentManagement;
import cc.comac.mom.bean.ResultDev;
import cc.comac.mom.entity.EquipDocumentManagementEntity;
import cc.comac.mom.util.ResultBean;
@FeignClient(name = "mom-equipment-mgmt-srv")
public interface EquipDocumentManagementService {

	@PostMapping(value="/p/cs/EquipDocumentManagementService/saveToServiceNoChunk",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public ResultBean saveToServiceNoChunk(@RequestPart("files") MultipartFile file);
	
	@RequestMapping(value = "/p/cs/EquipDocumentManagementService/batchDelete",method = RequestMethod.POST)
	public ResultBean batchDelete(@RequestBody List<EquipDocumentManagement> list);
	
	@RequestMapping(value = "/p/cs/EquipDocumentManagementService/selectAllByPage",method = RequestMethod.POST)
	public ResultDev selectAllByPage (@RequestBody EquipDocumentManagement equipDocumentManagement);
	
	@RequestMapping(value = "/p/cs/EquipDocumentManagementService/previewPdf",method = RequestMethod.GET)
	public byte[] previewPdf (@RequestParam(value = "documentId") long documentId);
	
	@RequestMapping(value = "/p/cs/EquipDocumentManagementService/download",method = RequestMethod.POST)
	public ResultBean download (@RequestParam(value = "documentId") Long documentId, @RequestParam(value = "response") HttpServletResponse response);
	
	@RequestMapping(value = "/p/cs/EquipDocumentManagementService/batchSave",method = RequestMethod.POST)
	public ResultBean batchSave(@RequestBody List<EquipDocumentManagement> equipDocumentManagement);
	
	@RequestMapping(value = "/p/cs/EquipDocumentManagementService/selectByDocumentId",method = RequestMethod.POST)
	public EquipDocumentManagementEntity selectByDocumentId(@RequestParam("documentId")Long documentId);
	
}
